cmake_minimum_required(VERSION 3.16)
project(cfg_MD)


set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
# set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)

add_library(cfg
  STATIC
  MSettings.cpp
  MSettings.h
)

# 把头文件目录“公开”出去，主工程直接 target_link_libraries 就能同时拿到库 + 头文件路径
target_include_directories(cfg PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})


target_link_libraries(cfg
  PRIVATE 
  Qt${QT_VERSION_MAJOR}::Core)
